// import { from } from 'core-js/core/array'
import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/index.vue'
import Welcome from '../views/welcome.vue'

import first1 from '../views/1_Data_Visualization/Cervical_Cancer_Visualization.vue'
import first2 from '../views/1_Data_Visualization/Diabetes_Visualization.vue'
import first3 from '../views/1_Data_Visualization/Heart_disease_Visualization.vue'
import second1 from '../views/2_Data_Predictions/Cervical_Cancer_Prediction.vue'
import second2 from '../views/2_Data_Predictions/Diabetes_Prognosis.vue'
import second3 from '../views/2_Data_Predictions/Heart_Disease_Prognosis.vue'


import third1 from '../views/3_Data_Upload/Cervical_Cancer_Upload.vue'
import third2 from '../views/3_Data_Upload/Diabetes_Upload.vue'
import third3 from '../views/3_Data_Upload/Heart_Disease_Upload.vue'

import hresult0 from '../views/illness_result/heart_result/not_ill.vue'
import hresult1 from '../views/illness_result/heart_result/ill.vue'
import tresult0 from '../views/illness_result/tnb_result/not_ill.vue'
import tresult1 from '../views/illness_result/tnb_result/ill.vue'
import gja_ill from '../views/illness_result/gja_result/ill.vue'
import gja_not_ill from '../views/illness_result/gja_result/not_ill.vue'
import Login from '../views/login.vue'
import test from '../views/test.vue'

import ill_yvce from '../views/4_Illness_yvce/yvce.vue'
import ill_yvce_wy from '../views/4_Illness_yvce/illness_yvce_result/ill_yvce_wy.vue'
import ill_yvce_gm from '../views/4_Illness_yvce/illness_yvce_result/ill_yvce_gm.vue'
import ill_yvce_gxy from '../views/4_Illness_yvce/illness_yvce_result/ill_yvce_gxy.vue'
import ill_yvce_nlgr from '../views/4_Illness_yvce/illness_yvce_result/ill_yvce_nlgr.vue'
import ill_yvce_sy from '../views/4_Illness_yvce/illness_yvce_result/ill_yvce_sy.vue'
import ill_yvce_tnb from '../views/4_Illness_yvce/illness_yvce_result/ill_yvce_tnb.vue'
import ill_yvce_xzb from '../views/4_Illness_yvce/illness_yvce_result/ill_yvce_xzb.vue'
import ill_yvce_fy from '../views/4_Illness_yvce/illness_yvce_result/ill_yvce_fy.vue'









Vue.use(VueRouter)

const routes = [
  {
    path:'/login',
    name:'Login',
    component:Login
  },
  {
    path: '/',
    name: 'Index',
    component: Index,
    redirect:'/login',
    children:[
      { path: '/welcome', component: Welcome },
      { path: '/Cervical_Cancer_Visualization', component:first1  },
      { path: '/Diabetes_Visualization', component:first2  },
      { path: '/Heart_disease_Visualization', component:first3  },
      { path: '/Cervical_Cancer_Prediction', component:second1  },
      { path: '/Diabetes_Prognosis', component:second2  },
      { path: '/Heart_Disease_Prognosis', component:second3 },
      
      { path: '/Cervical_Cancer_Upload', component:third1  },
      { path: '/Diabetes_Upload', component:third2  },
      { path: '/Heart_Disease_Prognosis', component:third3  },
      
      { path:'heart_result0',component:hresult0 },
      { path:'heart_result1',component:hresult1 },
      { path:'tnb_result0',component:tresult0},
      { path:'tnb_result1',component:tresult1},
      { path:'gja_ill',component:gja_ill },
      { path:'gja_not_ill',component:gja_not_ill },
      { path:'/ill_yvce',component:ill_yvce },
      { path:'/ill_yvce_wy',component:ill_yvce_wy },
      { path:'/ill_yvce_gm',component:ill_yvce_gm },
      { path:'/ill_yvce_gxy',component:ill_yvce_gxy },
      { path:'/ill_yvce_nlgr',component:ill_yvce_nlgr },
      { path:'/ill_yvce_sy',component:ill_yvce_sy },
      { path:'/ill_yvce_tnb',component:ill_yvce_tnb },
      { path:'/ill_yvce_xzb',component:ill_yvce_xzb },
      { path:'/ill_yvce_fy',component:ill_yvce_fy },
      
    ]
  },
  {
    path:'/test',
    component:test
  }
  

]

const router = new VueRouter({
  // mode:'history',
  routes
})


// router.beforeEach((to,from,next) =>{
//   if(to.path === '/login') return next()
//   // 获取token
//   const tokenStr = window.sessionStorage.getItem('token')
//   console.log(tokenStr)
//   // if(!tokenStr) return next('/login')
//   next()
// })

export default router
